package com.hu.hrm.fallback;

import com.hu.hrm.feignclients.PageStaticFeignClient;
import com.hu.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class PageStaticFeignClientFallbackFactory implements FallbackFactory<PageStaticFeignClient> {

    @Override
    public PageStaticFeignClient create(Throwable throwable) {
        return new PageStaticFeignClient() {
            @Override
            public AjaxResult pageStatic(String pageName, String redisDataKey) {
                throwable.printStackTrace();
                return AjaxResult.me().setSuccess(false).setMessage("页面静态化失败："+throwable.getMessage());
            }
        };
    }

}
